﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace KRF_KoreaSimulation
{
	class C_CMMN
	{
		public static Hashtable TIME = new Hashtable();
		public static Hashtable NDID = new Hashtable();
		public static Hashtable ACTS = new Hashtable();

		public string RMSG	= ".\\..\\..\\rslt_msg.txt";

		public const int ND = 8;
		public const int HC = 7;
		public const string T = "T";
		public const string F = "F";

		public string getTIME( int i )
		{
			if ( TIME.Contains(i) == false )
				return F;

			return TIME[i].ToString();
		}

		public string getNDID( int i )
		{
			if ( NDID.Contains( i ) == false )
				return F;

			return NDID[i].ToString();
		}

		public string getACT1( int i )
		{
			if ( ACTS.Contains( i ) == false )
				return F;

			return ACTS[i].ToString().Substring( 0, 2 );
		}

		public string getACT2( int i )
		{
			if ( ACTS.Contains( i ) == false )
				return F;

			return ACTS[i].ToString().Substring( 2, 2 );
		}

		public string getCode1Message( string code )
		{
			switch ( code )
			{
				case "SE":
					return "SEF";
				case "FR":
					return "False Report Injection Attack";
				case "ND":
					return "Node";
				default:
					return C_CMMN.F;
			}
		}

		public string getCode2Message( string code )
		{
			switch ( code )
			{
				case "GM":
					return "Generate MAC";
				case "GR":
					return "Generate Report";
				case "VR":
					return "Verfify Report";
				case "DR":
					return "Drop Report";
				case "PR":
					return "Pass Report";
				case "FM":
					return "Generate False MAC";
				case "FR":
					return "Generate False Report";
				case "SR":
					return "Send Report";
				case "RR":
					return "Receive Report";
				default:
					return C_CMMN.F;
			}
		}
	}
}
